package file;

public class ByteTest {

	private static StringBuffer sb = new StringBuffer();

	public static void splitBy4(String str, String splitStr) {

		int begin = 0;
		int end = str.indexOf(splitStr);
		int length = splitStr.length();

		while (end != -1) {
			if (begin == 0) {
				System.out.print(sb.toString());
				sb.setLength(0);
			}
			String subStr = str.substring(begin, end + 1 + length);
			System.out.println(subStr);
			begin = end + 1 + length;
			end = str.indexOf(splitStr, begin);
		}
		sb.append(str.substring(begin));
	}

	public static void main(String[] args) {
		String str = "12	4	1,2,4	1,2	5,4	12,0,4,3,5";

		splitBy4(str, "pic.auto.sohu.com");

		System.out.println(sb.toString());
	}
}
